import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:login_sdk/dao/login_dao.dart';
import 'package:login_sdk/utils/navigator_util.dart';

class Homepage extends StatefulWidget {
  const Homepage({super.key});

  @override
  State<Homepage> createState() => _HomepageState();
}

class _HomepageState extends State<Homepage> {
  get _listView => ListView(children: [
    _logoutBtn,
    Text('首页')
  ],);

  get _logoutBtn => ElevatedButton(onPressed: LoginDao.logOut, child: Text('登出'));

  @override
  Widget build(BuildContext context) {
    NavigatorUtil.updateContext(context);
    return Scaffold(
      appBar: AppBar(title: Text('title'),),
      body: _listView,
    );
  }
}
